package sevensoft.行为型模式.解释器模式;

import lombok.AllArgsConstructor;

@AllArgsConstructor
public class Minus extends AbstractExpression {

    private AbstractExpression left;

    public AbstractExpression right;

    @Override
    public int interpret(Context context) {
        return left.interpret(context) - left.interpret(context);
    }

    @Override
    public String toString() {
        return "(" + left + "-" + right + ")";
    }
}
